﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nuzzle.Protocol.Messages.Connection
{
    public class IdentificationMessage : NetworkMessage
    {
        public Types.Version.Version Version = new Types.Version.Version();
        public string Login { get; set; }
        public string Password { get; set; }
        public bool AutoConnect { get; set; }

        public IdentificationMessage(NetworkMessageReader reader)
            : base(reader)
        {
            this.Version.Deserialize(reader);
            this.Login = reader.Reader.readUTF();
            this.Password = reader.Reader.readUTF();

            //unused
            var certiflenght = reader.Reader.readUShort();

            this.AutoConnect = reader.Reader.readBoolean();
        }
    }
}
